<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		
		<div id="box" >不允许访问，5秒后跳转到A页</div>
		<div id="box1" style="display: none;">这是B的内容</div>
		
		<script type="text/javascript">
			var str = document.referrer;
			if(str == "") {
				var i = 4;
			setInterval(function() {
				document.getElementById("box").innerHTML="不允许访问，"+i+"秒后跳转到A页"
				i--;		
			}, 1000)
				setTimeout(function() {
					location.href = "来源AAA.html";
				}, 5000)
			} else {
				document.getElementById("box1").style.display="block"
				document.getElementById("box").style.display="none"
			}
			
		</script>
	</body>

</html>